package com.berchen.file;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;

/**
 * 打印流
 */
public class PrintWriterTest {
    public static void main(String[] args) throws FileNotFoundException, UnsupportedEncodingException {

        // 获取根路径
        String path = PrintWriterTest.class.getClassLoader().getResource("").getPath();
        PrintWriter printWriter = new PrintWriter(path + File.separator + "1.txt", "utf-8");
        // 打印流 print 直接输出  write 查询编码表 将查询到的数据输出
        printWriter.println("陈琬皓 换行");
        printWriter.write(100);

        printWriter.close();

    }
}
